<template>
  <div id="app">
    <keep-alive>
      <router-view/>
    </keep-alive>
  </div>
</template>

<script>
export default {
  name: 'app',
  data() {
    return {
      isLogin: true,
      lTime: null,
      cTime: null,
      oTime: 1,
      refreshTime: false
    }
  },
  created() {
    this.lTime = this.cTime = new Date().getTime();
  },
  mounted() {
    this.getLoginInfo();
  },
  methods: {
    onRefresh() {
      this.$router.go(0);
      this.refreshTime = false
    },
    getLoginInfo() {
      if (!this.$store.state.isLogin) {
        // _g.reLogin();
      }
      // let info = JSON.parse(localStorage.getItem('loginInfo')),
      //     isLogin = localStorage.getItem('isLogin') === 'true';
      // info = info ? info : null;
      // this.$store.commit('setLoginInfo', {key: 'info', value: info});
      // this.$store.commit('setLoginInfo', {key: 'isLogin', value: isLogin});
    }
  },
  watch: {
    $route(to) {
      if (to.meta.isShow === false) {
        this.$store.commit("isShowTabs", false);
        this.$store.commit("isShowTabbar", false);
      } else {
        this.$store.commit("isShowTabs", true);
        this.$store.commit("isShowTabbar", true);
      }
    }
  }
}
</script>

<style></style>
